package com.jiutong.meipengdai.ui.activitys;

import android.content.Context;
import android.view.View;
import android.widget.Button;
import android.widget.ImageView;
import android.widget.ListView;
import android.widget.RelativeLayout;
import android.widget.TextView;

import com.jiutong.meipengdai.R;
import com.jiutong.meipengdai.base.BaseActivity;
import com.jiutong.meipengdai.base.CommonAdapter;
import com.jiutong.meipengdai.base.ViewHolder;

import java.util.ArrayList;
import java.util.List;

import butterknife.Bind;
import butterknife.ButterKnife;
import butterknife.OnClick;

/**
 * 我的额度
 * Created by suxi on 2017/6/1.
 */

public class MyLimitActivity extends BaseActivity {
    @Bind(R.id.iv_back)
    ImageView ivBack;
    @Bind(R.id.tv_title)
    TextView tvTitle;
    @Bind(R.id.rl_comment_title)
    RelativeLayout rlCommentTitle;
    @Bind(R.id.tv_total)
    TextView tvTotal;
    @Bind(R.id.tv_total_des)
    TextView tvTotalDes;
    @Bind(R.id.lv_loan)
    ListView lvLoan;
    @Bind(R.id.btn_apply_loan)
    Button btnApplyLoan;
    @Bind(R.id.view_dotted_line)
    View dottedLine;

    @Override
    public int getLayoutResouceId() {
        return R.layout.activity_mylimit;
    }

    @Override
    protected void initView() {
        super.initView();
        ButterKnife.bind(this);
        tvTitle.setText("我的额度");
        dottedLine.setLayerType(View.LAYER_TYPE_SOFTWARE, null);

        ArrayList<String> strings = new ArrayList<>();
        int i = 0;
        while (i < 10){
            i++;
            strings.add(new String("测试数据"));
        }

        LimitsListAdapter limitsListAdapter = new LimitsListAdapter(mContext, strings, R.layout.view_loan_item);
        lvLoan.setAdapter(limitsListAdapter);
    }

    @OnClick({R.id.iv_back, R.id.btn_apply_loan})
    public void onViewClicked(View view) {
        switch (view.getId()) {
            case R.id.iv_back:
                break;
            case R.id.btn_apply_loan:
                break;
        }
    }

    public class LimitsListAdapter extends CommonAdapter<String>{

        public LimitsListAdapter(Context context, List<String> listDatas, int layoutId) {
            super(context, listDatas, layoutId);
        }

        @Override
        protected void fillData(ViewHolder holder, int position) {

        }
    }
}
